import request from './request';
// 统一管理项目全部接口文件
//商品分类数据接口
import mockRequsest from './mockAjax';
export const reqCategoryList  = ()=>{
    return request ({url:'/product/getBaseCategoryList',method:'get'});
}
//切记函数执行组要把服务器返回的数据返回
//获取banner(Home首页轮播图的接口)
export const reqBannerList = ()=>mockRequsest({url:'/banner',method:'get'});
//获取fooler数据(Home首页floor楼层轮播图的接口)
export const reqFloorList = ()=>mockRequsest({url:'/floor',method:'get'});
//搜索产品的接口[真实接口]
//URL：/api/list method:post 参数：需要携带
//这个接口【携带参数：最多十个，十个属性可以传递，页可以不传递，但是少给服务器一个空对象】
export const reqSearchList = (data)=>request({url:"/list",method:'post',data})
//获取商品详情接口
//api/item/{skuId} get
export const reqDetailList = (skuId)=>{ return request({url:`/item/${skuId}`,method:'get'}) }
//添加到购物车（对已有的物品数量进行改动）
//  /api/cart/addToCart/{ skuId }/{ skuNum }  post
export const reqAddOrUpdateShopCart = (skuId,skuNum) =>request({url:`/cart/addToCart/${skuId}/${skuNum}`,method:'post'});
//获取购物车的数据
// /cart/CartList
export const reqShopCartList = () =>request({url:"/cart/cartList",method:'get'});
//删除购物车某一商品的接口
//api/cart/deleteCart/{skuId}  delete
export const  reqDeleteCartById = (skuId)=>request({url:`/cart/deleteCart/${skuId}`,method:'delete'})
//选中与取消勾选
//api/cart/checkCart/{skuId}/{isChecked}  get 
//需要注意：从文档的拷贝过来的路径skuId小写的
export const  reqUpdateCartChecked = (skuId,isChecked)=>request({url:`/cart/checkCart/${skuId}/${isChecked}`,method:'get'});